import { BASE_URL } from '@/config/public'
import { METHOD, request } from '@/utils/request'

export default {
  // 某种类型的消息列表
  getMsgByType: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/message/list`,
      METHOD.POST_JSON_ENCRYPT,
      params
    )
  },
  //   标记所有未读消息为已读
  readAll: params => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/message/read/all`,
      METHOD.POST_JSON_ENCRYPT,
      params
    )
  },
  // 标记消息为已读
  readById: id => {
    return request(
      `${BASE_URL}/provider/ims/ejbb/message/read/${id}`,
      METHOD.PUT
    )
  },
  //   查询消息详情
  getMsgDetail: id => {
    return request(`${BASE_URL}/provider/ims/ejbb/message/${id}`, METHOD.GET)
  }
}
